package com.scs.application.modules.wm.controller;

import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.modules.sys.model.RestResult;
import com.scs.application.modules.wm.entity.StockCheck;
import com.scs.application.modules.wm.service.StockCheckService;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 */
@RestController
@RequestMapping("/wm/stock_check")
public class StockCheckController extends CrudController<StockCheckService, StockCheck>{
    /**
     * @Description： 盘点扫描唯一码
     */
    @GetMapping("/scan")
    public RestResult scan(String uc, String checkId) {
        return service.scan(uc, checkId);
    }

    /**
     * RFID扫码枪盘点扫描（扫描一个或多个）
     *
     * @param para
     * ucList :RFID集合
     * checkId :盘点主表id
     * @return
     */
    @PostMapping("/RFIDScan")
    public RestResult RFIDScan(@RequestBody Map<String, Object> para) {

        List<String> ucList = (List<String>) para.get("ucList");
        String checkId = (String) para.get("checkId");
        return service.RFIDScan(ucList, checkId);
    }
}
